// part1:C15:15.27:Bulk_quote.h
// class Bulk_quote.
// debug function.
#ifdef BULK_QUOTE_H__
#define BULK_QUOTE_H__
#include "Disc_quote.h" 
#include <iostream>
class Bulk_quote : public Disc_quote
{
public:
    using Disc_quote::Disc_quote;
    /*Bulk_quote(const string &book = "", double sales_price = 0.0,
        size_t qty = 0, double disc_rate = 0.0):
      Quote(book, sales_price), min_qty(qty), discount(disc_rate)
    {
        cout << "Bulk_constructor is running" << endl;
    }
    */

    double net_price(size_t cnt) const override
    {
        if (cnt >= quantity) 
        {
            return cnt * (1 - discount) * price;
        }
        else
        {
            return cnt * price;
        }
    }

    virtual void debug()
    {
        Quote::debug();
        cout << "min_qty = " << min_qty << " discount = " <<
          discount << endl;
    }
    ~Bulk_quote()
    {
        cout << "Bulk_quote destructor is running" << endl;
    }
private:
    size_t min_qty;
    double discount;
};
#endif
